import http from '@src/util/http';
import { objectDateToTimestamp } from 'pub-bbx-utils'

/**
 *
 * @description 获取部门详情
 * @returns {*}  - tagId
 */
export function getDeptTagDetail (params) {
  return http.get('/security/tag/getTagDetail', params)
}

/**
 *
 * @description 部门主页子部门
 * @returns {*}  - tagId
 * @returns {*}  - tagName
 */
export function getDeptChildTagList (params) {
  return http.post('/security/tag/getChildTagList', params)
}

/**
 *
 * @description 部门主页成员列表
 * @returns {*}  - tagId
 * @returns {*}  - keyword
 * @returns {*}  - pageNum
 * @returns {*}  - seeAllOrg
 */
export function getDeptUserList (params) {
  return http.post('/security/tag/userList', params,false)
}


/**
 *
 * @description 工单相关动态信息
 * @returns {*}  - tagId
 * @returns {*}  - pageNum
 * @returns {*}  - pageSize
 */
export function getDeptMyTaskRecords (params = {}) {
  // !国际化时间调整 增加时间戳参数 不改变原有参数
  objectDateToTimestamp(params, [
    'createTimeStart',
    'createTimeEnd',
  ])
  return http.post('/security/user/getMyTaskRecords', params)
}
/**
 *
 * @description 工作动态信息
 * @returns {*}  - tagId
 * @returns {*}  - pageNum
 * @returns {*}  - pageSize
 */
export function getDeptUserRecords (params) {
  // !国际化时间调整 增加时间戳参数 不改变原有参数
  objectDateToTimestamp(params, [
    'createTimeStart',
    'createTimeEnd'
  ])
  return http.post('/security/user/getUserRecords', params)
}

/**
 *
 * @description 部门主页服务事件
 * @returns {*}  - tagId
 * @returns {*}  - pageNum
 * @returns {*}  - pageSize
 */
export function getDeptEventsForUserView (params) {
  return http.post('/security/user/getEventsForUserView', params)
}

/**
 *
 * @description 部门主页工单列表
 * @returns {*}  - tagId
 * @returns {*}  - pageNum
 * @returns {*}  - pageSize
 */
export function getDeptTasksForUserView (params) {
  return http.post('/security/user/getTasksForUserView', params)
}

/**
 *
 * @description 选中的人是否有主管
 * @returns {*}  - tagId
 */
export function getTagTeamLeaders (params) {
  return http.post('/security/tag/getTagTeamLeaders', params)
}
